# -*- coding: utf-8 -*-
lst = file('./lib.txt' , 'r').readlines()
out = []
for x in lst:
    cn = x[:3]
    py = x[3:].replace("\n" , "")
    pyh = x[3:4]
    if len(out) == 0:
        out.append("insert into pre_py values('" + str(cn) + "' , '" + str(py) + "' , '" + str(pyh) + "')\n")
    else:
        out.append(",('" + str(cn) + "' , '" + str(py) + "' , '" + str(pyh) + "')\n")
out.append(";")
file('./lib.sql' , 'w').writelines(out)